﻿using HoverTree.HoverTreeFrame;
using HoverTree.Model;
using System;
using System.Collections.Generic;
using System.Web.Services;

namespace HoverTreeMobile.HvtAdmin.HvtPicture
{
    public partial class ImageSetList : System.Web.UI.Page
    {
        protected int _totalCount, _totalPageCount, _pageIndex, _pageSize;
        protected void Page_Load(object sender, EventArgs e)
        {

            _pageIndex = RequestHelper.GetQueryInt("pi", 1); ;
            _pageSize = 30;

            ImageSetSelect m_select = new ImageSetSelect();

            List<ImageSetInfo> m_list = new List<ImageSetInfo>();
            m_list = new HoverTree.BLL.HvtImageSet().HvtPageQuery(m_select, 2, _pageSize, _pageIndex, out _totalCount, out _totalPageCount);

            rptList.DataSource = m_list;
            rptList.DataBind();

            ltlPages.Text = HoverTree.HoverTreeFrame.WebUI.KeleyiPager.BuildPageIndex(_pageIndex, _totalPageCount);
        }

        [WebMethod]
        public static string Delete(int hvtid)
        {
            if (hvtid < 1)
                return "ID错误";

            return new HoverTree.BLL.HvtImageSet().Delete(hvtid);

        }

        [WebMethod]
        public static string HvtGenerateAll(int hvtid)
        {
            if (hvtid < 1)
                return "ID错误";

            return new HoverTree.BLL.HvtPicture().GenerateAll(hvtid);

        }
    }
}